package org.jeecg.modules.common.baseentity;

import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecg.config.mybatis.TenantContext;
import org.jeecgframework.poi.excel.annotation.Excel;

import java.util.List;

@Data
@NoArgsConstructor
@Accessors(chain = true)
@ToString(callSuper = true)
@SuperBuilder(toBuilder = true)
public class PublicBeanPage {

    /**学校编码（租户id）*/
    @Excel(name = "学校编码（租户id）", width = 15)
    @ApiModelProperty(value = "学校编码（租户id）")
    @TableField(exist = false)
    @Dict(dicCode = "id",dicText = "name",dictTable = "sys_tenant")
    private String tenantId =  TenantContext.getTenant() ;
    /**部门编码*/
    @Excel(name = "部门编码", width = 15)
    @ApiModelProperty(value = "部门编码")
    @Dict(dicCode = "org_code",dicText = "depart_name",dictTable = "sys_depart")
    @TableField(exist = false)
    private String sysOrgCode;

    @TableField(exist = false)
    private static final int DEFAULT_PAGE = -1;

    //数据总数
    @TableField(exist = false)
    protected long count;
    // 学年
    @TableField(exist = false)
    @Dict(dicCode = "id",dicText = "school_year_nickname",dictTable = "cou_school_year")
    private String schoolYearId;
    // 学期
    @TableField(exist = false)
    @Dict(dicCode = "id",dicText = "semester_name",dictTable = "cou_semester")
    private String semesterId;
    //下级部门：用于按当前登录部门实现数据过滤,只显示当前和下级部门的数据
    @TableField(exist = false)
    private List<String> subDepIdsList;
    //下级部门：用于按当前登录部门实现数据过滤,只显示当前和下级部门的数据
    @TableField(exist = false)
    private String  subDepSysOrgCodes;
    //用户身份：用于按当前登录用户的不同身份实现数据过滤
    @TableField(exist = false)
    @Dict(dicCode = "user_identity")
    private int userIdentity;
    /**一键查询字段*/
    @ApiModelProperty(value = "一键查询字段")
    @TableField(exist = false)
    private java.lang.String queryValues; //放在父类PublicBeanPage中

}
